<!--
 * @Author: zheng yong tao
 * @Date: 2022-01-15 15:34:05
 * @LastEditors: zheng yong tao
 * @LastEditTime: 2022-01-27 00:54:56
 * @Description: 
-->
<template>
  <div>
    <!-- <div style="display:flex;background:#1e2c51;color:white;text-align:left">
      <div style="width:45vw;">
        <div>
          <p>The atoms Blockchain Explorer</p>
          <el-input placeholder="" v-model="keyword">
            <template slot="prepend">
              <el-select v-model="value" placeholder="allfilter">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </template> 
            <template slot="append">
              <el-button type="primary" @click="selectKeyData"
                >search</el-button
              ></template
            >
          </el-input>
          <p>
            On this platform, you can review the security of contracts, includes
            almost all smart contract audit status of Bscscan, Ehterscan and
            Tronscan, and updates the contract audit status regularly every day
          </p>
        </div>
      </div>
      <div style="width:5vw"></div>
      <div style="width:45vw">
        <el-carousel :interval="4000" type="card" height="200px">
          <el-carousel-item v-for="item in 6" :key="item">
            <h3 class="medium">{{ item }}</h3>
          </el-carousel-item>
        </el-carousel> 
        <div
          style="color: white;
    padding: 20px;
    background: black;
    margin: 20px auto;
    border-radius: 20px;"
        >
          <submitInfo />
        </div>
      </div>
    </div> -->
    <div style="display:flex;flex-wrap:wrap;">
      <article-list
        :title="'deep'"
        :allArticles="allArticles"
        @refreshData="initData"
      ></article-list>
    </div>
  </div>
</template>

<script>
import articleList from "@/components/article/articleList1.vue";
import submitInfo from "./submitInfo.vue";
//import { getBlogs } from "@/config/api";
import { getTels } from "../config/api";
export default {
  name: "homePage",
  components: {
    articleList,
    submitInfo
  },
  data() {
    return {
      options: [
        {
          value: "address",
          label: "address"
        },
        {
          value: "name",
          label: "name"
        },
        {
          value: "high",
          label: "high"
        }
      ],
      value: "",
      allArticles: [],
      keyword: ""
    };
  },
  mounted() {
    this.initData();
  },
  methods: {
    async initData() {
      const res = await this.httpGet(getTels);
      res.code == 1
        ? (this.allArticles = res.data)
        : this.$message.success(res.msg);
    }
  },
  beforeDestroy() {}
};
</script>

<style lang="scss" scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
